<meta charset="utf-8">
<form method="post" action="">
    <input type="checkbox" value="踢足球" name="hobby[]">踢主球;
    <input type="checkbox" value="打篮球" name="hobby[]">打篮球;
    <input type="checkbox" value="乒乓球" name="hobby[]">乒乓球;
    <input type="checkbox" value="铅球" name="hobby[]">铅球;<br>
    <input type="submit" value="tijiao" name="tijiao">
</form>

<?php
    if(empty($_POST['tijiao']))
    {
        echo "666";
    }
   else {
       (!empty($_POST['tijiao']))
        $data = $_POST["hobby"];
       $b="";
        foreach ($data as $v) {
            $b.= " ".$v." ";


        }
       echo "你的爱好是$b";
       }
?>